package tsb.com.html5.exception;

import org.springframework.aop.ThrowsAdvice;
import org.springframework.stereotype.Component;

import java.lang.reflect.Method;

@Component
public class ExceptionInterceptor implements ThrowsAdvice {  
    
    public void afterThrowing(Method method, Object[] args, Object target,  
        Exception ex) throws Exception {          
        System.err.println("*************************");  
        System.err.println("Exception Capture");  
        System.err.println("Caught: " + ex.getClass().getName());  
                                System.out.println("Class: " + target.getClass().getName());  
        System.err.println("Method: " + method.getName());          
        System.err.println("*************************\n");  
    }  
}
